<?php
/**
 * crée l'affichage du background de l'OS
 * @return string l'affichage du background
 */
function Background_Create() {

return '<div id="background">
			<script type="text/javascript">
				setuserbackground();
			</script>
		</div>';
	
}
/**
 * crée la table du menu démarer de l'OS
 * @return string tableau du menu démarer
 */
function Power_Tab_Create() {

return '<table id="tabpower" cellspacing="0">
		<tr>
			<td class="tableft"></td>
			<td id="menutabpower">
				<a onclick="sleep();"><img src="./skins/controls/power.png" alt="Sleep" /></a>
				<a onclick="shutdown();"><img src="./skins/controls/shutdown.png" alt="Power" /></a>
			</td>
			<td class="tabright"></td>
		</tr>
		<tr>
			<td class="tabbottomleft"></td>
			<td class="menutabbottom"><a style="float:right;" onclick="showhide(\'tabpower\');"><img src="./skins/controls/cross.png" alt="Close" /></a></td>
			<td class="tabbottomright"></td>
		</tr>
	</table>';
	
}
/**
 *
 * @return <type>
 */
function Power_Button_Create() {

return '<div id="power">
	<span style="width:100%; height:100%; display:block;" onclick="showhide(\'tabpower\');"><img src="./skins/controls/power.png" alt="Power" /></span>
	</div>';

}
/**
 *
 * @return <type>
 */
function Clock_Tab_Create() {

return '<table id="tabhorloge" cellspacing="0">
		<tr>
			<td class="tableft"></td>
			<td id="menutabhorloge" onclick="changehorloge();"></td>
			<td class="tabright"></td>
		</tr>
		<tr>
			<td class="tabbottomleft"></td>
			<td class="menutabbottom"><a style="float:right;" onclick="showhide(\'tabhorloge\');"><img src="./skins/controls/cross.png" alt="Close" /></a></td>
			<td class="tabbottomright"></td>
		</tr>
	</table>';

}
/**
 *
 * @return <type>
 */
function Clock_Button_Create() {

return '<div id="horloge">
		<span id="horlogespan" style="width:100%; height:100%; display:block;" onclick="showhide(\'tabhorloge\');"><script type="text/javascript">horloge();</script></span>
	</div>';
	
}
/**
 *
 * @return string
 */
function Home_Tab_Create() {

$return = '<table id="tab" cellspacing="0">
		<tr>
			<td class="tableft"></td>
			<td id="menutab">
			';
			
$dir = @opendir("./modules/");
while ($file = readdir($dir))
{
	if (is_dir("./modules/".$file) && $file != "." && $file != ".." && file_exists("./modules/".$file."/conf.xml"))
	{
		$prgmdata = Module_XMLConf_Load($file);
		$return .= Home_PrgmTitleA_Create($file,$prgmdata);
	}
}
closedir($dir);
			
$return .= '</td>
			<td class="tabright"></td>
		</tr>
		<tr>
			<td class="tabbottomleft"></td>
			<td class="menutabbottom"><a style="float:right;" onclick="showhide(\'tab\');"><img src="./skins/controls/cross.png" alt="Close" /></a></td>
			<td class="tabbottomright"></td>
		</tr>
	</table>';

return $return;
	
}
/**
 *
 * @return <type>
 */
function Home_Buttons_Create() {

	return '<table id="tabliens" cellspacing="0">
		<tr>
			<td id="liensleft"></td>
			<td id="liens">
					<ul id="menu">
						<li><a style="cursor:pointer;"><img src="./skins/menu/accueil.png" alt="Accueil" onclick="showhide(\'tab\');"/></a></li>
						<li style="width:16px;"><img src="./skins/menu/separateur.png" alt="" /></li>
						<li><a href="./diaporama.php#menu"><img src="./skins/menu/photos.png" alt="Diaporama" /></a></li>
						<li><a href="./musiques.php"><img src="./skins/menu/musiques.png" alt="Musiques" /></a></li>
						<li style="width:16px;"><img src="./skins/menu/separateur.png" alt="" /></li>
						<li><a href="./contact.php"><img src="./skins/menu/contact.png" alt="Contact" /></a></li>
					</ul>
			</td>
			<td id="liensright"></td>
		</tr>
	</table>';
	
}
/**
 *
 * @param string $title
 * @param string $datas
 * @return string
 */
function Home_PrgmTitleA_Create($title,$datas) {

	return '<a onclick="CreateWindow(\''.$title.'\','.$datas["width"].','.$datas["height"].','.$datas["resizable"].','.$datas["movable"].','.$datas["autofullscreen"].',\''.$datas["programicon"].'\',\''.$datas["initfile"].'\');hide(\'tab\');">'.$datas["appname"].'</a>';
				
}

?>